package com.mycinema.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.mycinema.dao.CategoryDao;
import com.mycinema.dao.MyBatisUtil;
import com.mycinema.entity.Category;

public class CategoryDaoImpl implements CategoryDao {

	public List<Category> getAll() {
		SqlSession session = null;
		try {
			session = MyBatisUtil.openSession();
			CategoryDao categoryDao = session.getMapper(CategoryDao.class);
			return categoryDao.getAll();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (session != null) {
				session.close();
			}
		}
		return null;
	}

}
